$(() => {
    const $logoutBtn = $('#logoutBtn')

    $logoutBtn.click(() => {
        if (confirm('您确定要退出吗？')) {
            $.ajax({
                type: 'POST',
                url: '/logout',
                success() {
                    location.href = '/admin/login.html'
                },
                error() {
                    alert('退出失败')
                }
            })
        }
    })
})
